package com.quantdo.demo.action;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.ui.IWorkbenchWindow;

import com.quantdo.demo.dialog.LoginDialog;

public class LoginAction extends Action {

	private IWorkbenchWindow window;

	public LoginAction() {
		super();
		this.setText("Login");
	}

	public LoginAction(IWorkbenchWindow window) {
		this.window = window;
	}

	@Override
	public void run() {
		System.out.printf("class:%s, function:%s() enter \n", LoginAction.class, "run");
		LoginDialog loginDialog = new LoginDialog(null);
		if(IDialogConstants.OK_ID == loginDialog.open()){
			System.out.printf("结果:%s \n", IDialogConstants.OK_ID);
		}
	}

}
